package service;

import dao.userDaoImp;
import entity.user;
import tools.baseServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author malguy-wang sir
 * @create ---
 */
@WebServlet("/user/*")
public class userService extends baseServlet {
    private userDaoImp daoImp;
    public void findAll(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        daoImp.findAll();
    }
    public void findByName(HttpServletRequest req, HttpServletResponse resp)throws Exception{
        boolean username = daoImp.findByName(req.getParameter("username"));
        boolean password = daoImp.findByName(req.getParameter("password"));
        if(username&&password){
            resp.sendRedirect("http://localhost:8080/test.html");
        }
    }
}
